import 'package:flutter/material.dart';

/// Container API :  https://api.flutter-io.cn/flutter/widgets/Container-class.html
///
class HelloContainer2 extends StatelessWidget {
  const HelloContainer2({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Hello Container',
      home: Scaffold(
        body: Center(
          child: Container(
            child: Text('Hello JsPang',
              style: TextStyle(fontSize: 40.0),),
            alignment: Alignment.topLeft,
            width: 500.0,
            height: 400.0,
            // color: Colors.lightBlue,
            // 渐变色
            decoration: BoxDecoration(
              gradient: LinearGradient(colors: [Colors.lightBlue, Colors.greenAccent, Colors.purple]),
              // 边框
              border: Border.all(width: 2.0, color: Colors.red)
            ),
            // 添加内边距(padding)
            // padding: const EdgeInsets.all(10.0),
            padding: const EdgeInsets.fromLTRB(10.0, 30.0, 0.0, 0.0),
            margin: const EdgeInsets.all(10.0),
          ),
        ),
      ),
    );
  }

}